package morningcat.study.spring.starter1;

import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.io.ClassPathResource;

/**
 * XXX
 *
 * @author mengzhang6
 * @date 2018/11/20 12:03
 */
public class Starter4 {

    public static void main(String[] args) {
        StaticApplicationContext ctx = new StaticApplicationContext();
        new XmlBeanDefinitionReader(ctx).loadBeanDefinitions(new ClassPathResource("applicationContext.xml"));
        ctx.refresh();

        HelloService myBean = (HelloService) ctx.getBean("helloService");
        System.out.println(myBean.hello());
    }
}


